import request from '@/utils/request'

export default {
    //课程分类列表
    //current当前页,limit每页记录数,teacherQuery条件对象
    addCourseInfo(courseInfo) {
        return request({
            url: `/eduservice/course/addCourseInfo`,
            method: 'post',
            data: courseInfo

        })
    },
    //查询所有讲师
    getListTeacher() {
        return request({
            url: '/eduservice/teacher/findAll',
            method: 'get'
        })
    },
    //根据课程id查询课程的基本信息
    getCourseInfoId(id) {
        return request({
            url: '/eduservice/course/getCourseInfo/'+id,
            method: 'get'
        })
    },
    //修改课程信息
    updateCourseInfoId(courseInfo) {
        return request({
            url: '/eduservice/course/updateCourseInfo',
            method: 'post',
            data:courseInfo
        })
    },
    //课程确认信息的显示
    getPublishCourseInfo(id){
        return request({
            url: '/eduservice/course/getPublishCourseInfo/'+id,
            method: 'get'
        })
    },
    //课程的最终发布
    publishCourse(id){
        return request({
            url: '/eduservice/course/publishCourse/'+id,
            method: 'post'
        })

    },
    //查询课程列表
    getCourseList(){
        return request({
            url: '/eduservice/course/getCourseList',
            method: 'get'
        })

    },
    //通过id删除课程所有信息
    deleteCourseAllMessage(courseId){
        return request({
            url: '/eduservice/course/deleteCourse/'+courseId,
            method: 'delete'
        })
    },


    getCourseListPage(current,limit,teacherQuery) {
        return request({
            //url: '/eduservice/teacher/pageTeacherCondition/'+current+"/"+limit,
            url: `/eduservice/course/pageCourseCondition/${current}/${limit}`,
            method: 'post',
            //teacherQuery条件对象，后端使用RequestBody获取数据
            //data表示把对象转换json进行传递到接口里面
            data: teacherQuery
          })
    },
    

}

